#include <stdio.h>
#include <math.h>
typedef struct 
{
double re;
double im;
} complex;
complex a,b,suma;
double modul();
double arg();
void adcomplex(complex a, complex b);
/*
void adcomplex(complex*a, complex*b);

void adcomplex(complex& a, complex& b);
complex diff(complex a, complex b);
complex* minus(complex a, complex b);
complex&dif(complex a,complex b);
bool equals(complex* a, complex* b);
*/
int main()
{
printf("Coef real pt a:"); scanf("%lf",&a.re);
printf("Coef img pt a:"); scanf("%lf",&a.im);
printf("Coef real pt b:"); scanf("%lf",&b.re);
printf("Coef img pt b:"); scanf("%lf",&b.im);
printf("Modulul lui a este %lf\n:",modul());
adcomplex(a,b);
printf("Partea reala a lui a+b:%lf\n Partea imaginara a lui a+b:%lf\n",suma.re,suma.im);
return 0;
}
double modul()
{
return sqrt(a.re*a.re+a.im*a.im);
}
void adcomplex(complex a, complex b)
{
suma.re=a.re+b.re;
suma.im=a.im+b.im;
}
